package com.xuan.webfinally.mapper;

import com.xuan.webfinally.entity.SlopeSensorList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 边坡监测传感器列表 Mapper 接口
 * </p>
 *
 * @author gyuxuan
 * @since 2025-05-18
 */
public interface SlopeSensorListMapper extends BaseMapper<SlopeSensorList> {
    @Select("SELECT count(*) FROM slope_sensor_list where dept_id = #{deptId}")
    int getAllLd(Long deptId);

    @Select("SELECT count(*) FROM slope_sensor_list where dept_id = #{deptId}")
    int selectPointNumber(Long deptId1);

    @Select("SELECT count(*) FROM slope_sensor_list where dept_id = #{deptId} and data_status = '离线'")
    int getLiXian(Long deptId1);

    @Select("SELECT count(*) FROM slope_sensor_list where dept_id = #{deptId}")
    int getWarning(Long deptId1);


    @Select("SELECT sensor_code FROM slope_sensor_list where device_sn = #{deviceSn} and monitor_id = #{monitorId}")
    String getMonitorCode(String monitorId, String deviceSn);
}
